package com.example.mysaat.service_menu_manual_test.Listeners;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.view.View;

import com.example.mysaat.R;

import java.util.List;

public class MyFailOnclickListener implements View.OnClickListener {

    private Activity activity = null;
    private List list = null;

    public MyFailOnclickListener(Activity activity, List list) {
        this.activity = activity;
        this.list = list;
    }
    @Override
    public void onClick(View view) {
        AlertDialog mAlertDialog = new AlertDialog.Builder(activity)
                .setMessage(activity.getString(R.string.fail_btn_message))
                .setPositiveButton(activity.getString(R.string.dlg_ok),
                        new DialogInterface.OnClickListener() {
                            public void onClick(DialogInterface dialog,
                                                int which) {
                                // 需要将错误的信息进行记录
                                activity.finish();
                            }
                        })
                .setNegativeButton(activity.getString(R.string.fail_btn_text), null)
                .create();
        mAlertDialog.show();
    }
}
